<!DOCTYPE html>
<html lang="zh-CN">
    <head>
        <meta charset="UTF-8" />
        <title>index</title>
        <style>
            .wrap {
                width: 500px;
                height: 500px;
                background-color: #ccc;
                position: relative;
            }
            .inner {
                width: 300px;
                height: 300px;
                background-color: pink;
                position: absolute;
                top: 0;
                left: 0;
                right: 0;
                bottom: 0;
                margin: auto;
            }
        </style>
    </head>
    <body>
        <div class="wrap">
            <div class="inner">

            </div>
        </div>
    </body>

</html>